


package model;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author Aluno
 */
public class GerenciaConexão {
    public static Connection getConexao(){
        Connection Conexao = null;
        String url ="jdbc:mysql://localhost:3306/sisclilo";
        String usuario ="root";
        String senha ="fals123";  
     try{
        Class.forName("org.gjt.mm.mysql.Driver");
        Conexao = DriverManager.getConnection(url,usuario,senha);
        System.out.println ("conectado com sucesso");
   
    }catch(ClassNotFoundException cnfe){
        System.out.println ("erro ao carregar driver");  
        System.out.println (cnfe.getMessage());
     
    }
    catch(SQLException sqle){
        System.out.println ("não é possivel conectar com BD");   
        System.out.println (sqle.getMessage());
    } 
    return Conexao ;
    }

    static Statement createStatement() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
    
}
